using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using WMSSystem.Application.Contracts.Workflow.Dto;

namespace WMSSystem.Application.Contracts.Workflow
{
    /// <summary>
    /// 工作流服务接口
    /// </summary>
    public interface IWorkflowService
    {
        /// <summary>
        /// 创建工作流实例
        /// </summary>
        /// <param name="input">创建输入</param>
        /// <returns>工作流实例ID</returns>
        Task<ApiResponse<string>> CreateWorkflowInstanceAsync(CreateWorkflowInstanceDto input);

        /// <summary>
        /// 审批工作流
        /// </summary>
        /// <param name="input">审批输入</param>
        /// <returns>审批结果</returns>
        Task<ApiResponse<bool>> ApproveWorkflowAsync(WorkflowApprovalDto input);

        /// <summary>
        /// 获取工作流实例列表
        /// </summary>
        /// <returns>工作流实例列表</returns>
        Task<ApiResponse<List<WorkflowInstanceDto>>> GetWorkflowInstancesAsync();

        /// <summary>
        /// 获取工作流实例
        /// </summary>
        /// <param name="workflowInstanceId">工作流实例ID</param>
        /// <returns>工作流实例</returns>
        Task<ApiResponse<WorkflowInstanceDto>> GetWorkflowInstanceAsync(string workflowInstanceId);

        /// <summary>
        /// 获取工作流状态
        /// </summary>
        /// <param name="workflowInstanceId">工作流实例ID</param>
        /// <returns>工作流状态</returns>
        Task<ApiResponse<object>> GetWorkflowStatusAsync(string workflowInstanceId);

        /// <summary>
        /// 获取业务相关的工作流实例
        /// </summary>
        /// <param name="businessType">业务类型</param>
        /// <param name="businessId">业务ID</param>
        /// <returns>工作流实例</returns>
        Task<ApiResponse<WorkflowInstanceDto>> GetWorkflowInstanceByBusinessAsync(string businessType, Guid businessId);

        /// <summary>
        /// 获取待审批列表
        /// </summary>
        /// <returns>待审批列表</returns>
        Task<ApiResponse<List<WorkflowInstanceDto>>> GetPendingApprovalsAsync();

        /// <summary>
        /// 获取待审批列表
        /// </summary>
        /// <param name="approverId">审批人ID</param>
        /// <returns>待审批列表</returns>
        Task<ApiResponse<List<WorkflowInstanceDto>>> GetPendingApprovalListAsync(Guid approverId);

        /// <summary>
        /// 获取我的审批记录
        /// </summary>
        /// <param name="approverId">审批人ID</param>
        /// <returns>审批记录列表</returns>
        Task<ApiResponse<List<WorkflowInstanceDto>>> GetMyApprovalHistoryAsync(Guid approverId);
    }
} 